package acwing;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class ac797 {
    static final int N = 100010;
    static int[] a = new int[N];
    static int[] b = new int[N];
    public static void main(String[] args) throws IOException {
        BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
        String[] s1 = in.readLine().split(" ");
        int n = Integer.parseInt(s1[0]);
        int m = Integer.parseInt(s1[1]);
        String[] ls = in.readLine().split(" ");
        for(int i = 1; i <= n; i ++ ) {
            a[i] = Integer.parseInt(ls[i - 1]);
            b[i] = a[i] - a[i - 1];
        }
        while(m -- > 0) {
            String[] swt = in.readLine().split(" ");
            int l = Integer.parseInt(swt[0]);
            int r = Integer.parseInt(swt[1]);
            int c = Integer.parseInt(swt[2]);
            Insert(b, l, r, c);
        }
        for(int i = 1; i <= n; i ++ ){
            a[i] = a[i - 1] + b[i];
            System.out.print(a[i] + " ");
        }
    }

    public static void Insert(int[] a, int l, int r, int c){
        a[l] += c;
        a[r + 1] -= c;
    }
}
